﻿namespace Aleck
{
    using Atlantis.Win32;

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Program
    {
        /// <summary>
        ///     The console's window handle
        /// </summary>
        private static IntPtr hWndConsole = IntPtr.Zero;
        /// <summary>
        ///     The console's system menu
        /// </summary>
        private static IntPtr hWndMenu = IntPtr.Zero;

        public static void Main(string[] args)
        {
            hWndConsole = WinForms.GetConsoleWindow();

            if (hWndConsole != IntPtr.Zero)
            {
                hWndMenu = WinForms.GetSystemMenu(hWndConsole, false);

                if (hWndMenu != IntPtr.Zero)
                {
                    WinForms.EnableMenuItem(hWndMenu, NativeConstants.SC_CLOSE, (uint)(NativeConstants.MF_GRAYED));
                }

                WinForms.ShowWindow(hWndConsole, NativeConstants.SW_HIDE);
            }

            Console.ReadKey(true);
        }
    }
}
